package com.py.framework.core.rest.support;

import java.util.List;
import java.util.Map;

/**
 * restTemplate 服务
 *
 */
public interface RestTemplateService {
	/**
	 * 调用get请求返回entity
	 * 
	 * @param url
	 * @param map
	 * @param classes
	 * @return
	 * @throws Exception
	 */
	public <T> T getForEntity(String url, Map<String, Object> map, Class<T> classz);

	/**
	 * 调用get请求返回list
	 * 
	 * @param <T>
	 * 
	 * @param url
	 * @param map
	 * @param classes
	 * @return
	 * @throws Exception
	 */
	public <T> List<T> getForList(String url, Map<String, Object> map, Class<T> classes);

	/**
	 * 调用POST请求返回entity
	 * 
	 * @param url
	 * @param request
	 * @param map
	 * @param classes
	 * @return
	 * @throws Exception
	 */
	public <T> T postForEntity(String url, Object request, Map<String, Object> map, Class<T> classes);

	/**
	 * @param url
	 * @param request
	 * @param classes
	 * @return
	 * @throws MemberCenterException
	 */
	public <T> T postForEntity(String url, Object request, Class<T> classes);

	/**
	 * 调用POST请求返回list
	 * 
	 * @param <T>
	 * 
	 * @param url
	 * @param request
	 * @param map
	 * @param classes
	 * @return
	 * @throws Exception
	 */
	public <T> List<T> postForList(String url, Object request, Map<String, Object> map, Class<T> classes);

	/**
	 * @param <T>
	 * @param url
	 * @param request
	 * @param classes
	 * @return
	 * @throws MemberCenterException
	 */
	public <T> List<T> postForList(String url, Object request, Class<T> classes);
	
}